import axios from 'axios'

export const getUsers = async () => {
    let res = await axios({
         method:"post",
         url:"api/users/getUsers"
    });
    console.log(res)
    return res.data
} 

export const updateUsers = async (parameter) => {
    let res = await axios({
         method:"post",
         url:"api/users/updateUsers",
         data:{
             parameter
         }
    });
   
    return res.data
} 

export const deleteUsers = async (_id) => {
    let res = await axios({
         method:"post",
         url:"api/users/deleteUsers",
         data:{
             _id
         }
    });
   
    return res.data
}

export const addUser = async (parameter) => {
    let res = await axios({
         method:"post",
         url:"api/users/addUser",
         data:{
            parameter
         }
    });
   
    return res.data
} 

export const searchUer = async (parameter) => {
    let res = await axios({
         method:"post",
         url:"api/users/searchUser",
         data:{
             parameter
         }
    });
   
    return res.data
} 